<template>
    <div class="common-layout">
        <el-container style="height: 100%;">
            <el-header>
                <el-row>
                    <el-col :span="12" style="font-size: 20px;color:aquamarine">
                        <h1>爱吃兔溯源</h1>
                    </el-col>
                    <el-col :span="12" style="font-size: 15px;text-align:right;">
                        <el-icon>
                            <User />
                        </el-icon>
                        <el-icon>
                            <SwitchButton />
                        </el-icon>
                        登录人 : admin &nbsp;&nbsp;角色 : 管理员&nbsp;&nbsp;
                        <el-button type="danger" @click="exit">退出登录</el-button>
                    </el-col>
                </el-row>
            </el-header>
            <el-container style="height: 100%;">
                <el-aside width="250px">
                    <el-row class="tac">
                        <el-col :span="14">
                            <el-menu style="height: 937px;width:250px" active-text-color="#ffd04b"
                                background-color="#545c64" class="el-menu-vertical-demo" default-active="router.push"
                                text-color="#fff" router>
                                <el-sub-menu index="/Product">
                                    <template #title>
                                        <el-icon>
                                            <location />
                                        </el-icon>
                                        <span>爱吃兔溯源管理</span>
                                    </template>
                                    <el-sub-menu index="/Traceabilities">
                                        <template #title>溯源管理</template>
                                        <el-menu-item index="/Traceabilities">新增/修改</el-menu-item>
                                        <el-menu-item index="/Traceabilities">导出设置</el-menu-item>
                                    </el-sub-menu>
                                    <el-sub-menu index="/Bree">
                                        <template #title>养殖信息</template>
                                        <el-menu-item index="/Bree">养殖信息-设置养殖信息</el-menu-item>
                                        <el-menu-item index="1-2-1">养殖信息-设置企业信息</el-menu-item>
                                    </el-sub-menu>
                                    <el-sub-menu index="1-3">
                                        <template #title>屠宰信息</template>
                                        <el-menu-item index="1-3-1">屠宰信息-设置屠宰信息</el-menu-item>
                                        <el-menu-item index="1-3-2">屠宰信息-设置企业信息</el-menu-item>
                                    </el-sub-menu>
                                    <el-sub-menu index="1-4">
                                        <template #title>深加工信息</template>
                                        <el-menu-item index="1-4-1">深加工信息-设置深加工信息</el-menu-item>
                                        <el-menu-item index="1-4-2">深加工信息-设置供应商信息</el-menu-item>
                                        <el-menu-item index="1-4-3">深加工信息-设置企业信息</el-menu-item>
                                    </el-sub-menu>
                                </el-sub-menu>
                            </el-menu>
                        </el-col>

                    </el-row>
                </el-aside>
                <el-main style="height: calc(100vh - 64px); overflow-y: auto;">
                    <RouterView />
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from '../components/HelloWorld.vue'
import { useRouter } from 'vue-router';
import { useCounterStore } from '@/stores/counter';
const store = useCounterStore()
const router = useRouter()
//退出
const exit = () => {
    router.push("/")
}

</script>
<style scoped>
header {
    line-height: 1.5;
    max-height: 100vh;
}

.logo {
    display: block;
    margin: 0 auto 2rem;
}

nav {
    width: 100%;
    font-size: 12px;
    text-align: center;
    margin-top: 2rem;
}

nav a.router-link-exact-active {
    color: var(--color-text);
}

nav a.router-link-exact-active:hover {
    background-color: transparent;
}

nav a {
    display: inline-block;
    padding: 0 1rem;
    border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
    border: 0;
}

@media (min-width: 1024px) {
    header {
        display: flex;
        place-items: center;
        padding-right: calc(var(--section-gap) / 2);
    }

    .logo {
        margin: 0 2rem 0 0;
    }

    header .wrapper {
        display: flex;
        place-items: flex-start;
        flex-wrap: wrap;
    }

    nav {
        text-align: left;
        margin-left: -1rem;
        font-size: 1rem;

        padding: 1rem 0;
        margin-top: 1rem;
    }
}
</style>